package cv.gzd.robot.listener;

import cv.gzd.robot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

/**用于初始化项目，添加超级管理员
 * @Author: Jun
 * @Date: 2018/8/30 16:33
 */
@Component
public class initAdminiListener implements ApplicationListener<ContextRefreshedEvent> {
@Autowired
UserService userService;
    @Override
    public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
        userService.initRoot();
    }
}
